import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

// 背景图片
DecorationImage getDecorationBg(String assets) {
  return DecorationImage(image: AssetImage(assets), fit: BoxFit.fill);
}

Decoration getBorderDecoration({bool isShowBorder = true}) {
  return BoxDecoration(
    borderRadius: const BorderRadius.all(Radius.circular(8)),
    gradient: const LinearGradient(
      begin: Alignment.topCenter,
      end: Alignment.bottomCenter,
      colors: [
        Color(0xFFDEFAA1),
        Color(0xFFEBFFC3),
      ],
    ),
    border:isShowBorder ? Border.all(
      color: Colors.black,
      width: 2.0, // 边框宽度，可以根据需要调整
    ) :null,
  );
}

///top radius
getTopRadius({double radius = 8.0, bool isAll = false}) {
  return isAll
      ? BorderRadius.all(Radius.circular(radius))
      :BorderRadius.only(
      topLeft: Radius.circular(radius), topRight: Radius.circular(radius)) ;
}

LinearGradient getGradient() {
  return const LinearGradient(
      begin: Alignment.centerLeft,
      end: Alignment.centerRight,
      colors: [Color(0xffffffff), Color(0xffB1F526), Color(0xffffffff)]);
}
